<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>netaddr.address</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://netaddr.googlecode.com/">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="netaddr-module.html">Package&nbsp;netaddr</a> ::
        Module&nbsp;address
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="netaddr.address-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module address</h1><p class="nomargin-top"><span class="codelink"><a href="netaddr.address-pysrc.html">source&nbsp;code</a></span></p>
<p>network address classes (IP, EUI) and associated aggregate classes 
  (CIDR, Wildcard and IPRange).</p>

<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.AddrTypeDescriptor-class.html" class="summary-name">AddrTypeDescriptor</a><br />
      A descriptor that checks addr_type property assignments for 
        validity and also keeps the strategy property in sync with any 
        changes made.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.AddrValueDescriptor-class.html" class="summary-name">AddrValueDescriptor</a><br />
      A descriptor that checks assignments to the named parameter passed 
        to the constructor.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.StrategyDescriptor-class.html" class="summary-name">StrategyDescriptor</a><br />
      A descriptor that checks strategy property assignments for validity
        and also keeps the addr_type property in sync with any changes 
        made.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.PrefixLenDescriptor-class.html" class="summary-name">PrefixLenDescriptor</a><br />
      A descriptor that checks prefixlen property assignments for 
        validity based on address type.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.FormatDescriptor-class.html" class="summary-name">FormatDescriptor</a><br />
      A descriptor that checks formatter property assignments for 
        validity.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.Addr-class.html" class="summary-name">Addr</a><br />
      The base class containing common functionality for all subclasses 
        representing various network address types.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.EUI-class.html" class="summary-name">EUI</a><br />
      Represents an IEEE EUI (Extended Unique Identifier) indentifier.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.IP-class.html" class="summary-name">IP</a><br />
      Represents <b>individual</b> IPv4 and IPv6 addresses.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.IPRange-class.html" class="summary-name">IPRange</a><br />
      Represents arbitrary contiguous blocks of IPv4 and IPv6 addresses 
        using only a lower and upper bound IP address.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.CIDR-class.html" class="summary-name">CIDR</a><br />
      Represents blocks of IPv4 and IPv6 addresses using CIDR (Classless 
        Inter-Domain Routing) notation.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.Wildcard-class.html" class="summary-name">Wildcard</a><br />
      Represents blocks of IPv4 addresses using a wildcard or glob style 
        syntax.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.IPRangeSet-class.html" class="summary-name">IPRangeSet</a><br />
      <b>*EXPERIMENTAL*</b> A customised Python set class that deals with
        collections of IPRange class and subclass instances.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address-module.html#nrange" class="summary-sig-name">nrange</a>(<span class="summary-sig-arg">start</span>,
        <span class="summary-sig-arg">stop</span>,
        <span class="summary-sig-arg">step</span>=<span class="summary-sig-default">1</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      An xrange work alike generator that produces sequences of IP 
      addresses based on start and stop addresses, in intervals of step 
      size.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#nrange">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address-module.html#cidr_to_bits" class="summary-sig-name">cidr_to_bits</a>(<span class="summary-sig-arg">cidr</span>)</span><br />
      Returns:
      a tuple containing CIDR in binary string format and addr_type.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#cidr_to_bits">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address-module.html#bits_to_cidr" class="summary-sig-name">bits_to_cidr</a>(<span class="summary-sig-arg">bits</span>,
        <span class="summary-sig-arg">addr_type</span>=<span class="summary-sig-default">0</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      a CIDR object or string (determined by fmt).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#bits_to_cidr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address-module.html#AT_STRATEGIES" class="summary-name">AT_STRATEGIES</a> = <code title="{AT_UNSPEC: None, AT_INET: ST_IPV4, AT_INET6: ST_IPV6, AT_LINK: ST_EUI\
48, AT_EUI64: ST_EUI64,}">{AT_UNSPEC: None, AT_INET: ST_IPV4, AT_INET6: <code class="variable-ellipsis">...</code></code><br />
      Address type to strategy object lookup dict.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="nrange"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">nrange</span>(<span class="sig-arg">start</span>,
        <span class="sig-arg">stop</span>,
        <span class="sig-arg">step</span>=<span class="sig-default">1</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#nrange">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>An xrange work alike generator that produces sequences of IP addresses
  based on start and stop addresses, in intervals of step size.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>start</code></strong> - first IP address string or <a 
          href="netaddr.address.IP-class.html" class="link">IP</a> object 
          in range.</li>
        <li><strong class="pname"><code>stop</code></strong> - last IP address string or <a href="netaddr.address.IP-class.html"
          class="link">IP</a> object in range</li>
        <li><strong class="pname"><code>step</code></strong> - (optional) size of step between address in range. (Default: 1)</li>
        <li><strong class="pname"><code>fmt</code></strong> - (optional) callable used on addresses returned. (Default: None - 
          <a href="netaddr.address.IP-class.html" class="link">IP</a> 
          objects). Supported options :-
          <ul>
            <li>
              <code>str</code> - IP address in string format
            </li>
            <li>
              <code>int</code>, <code>long</code> - IP address as an 
              unsigned integer
            </li>
            <li>
              <code>hex</code> - IP address as a hexadecimal number
            </li>
            <li>
              <a href="netaddr.address.IP-class.html" class="link">IP</a> 
              class/subclass or callable that accepts 
              <code>addr_value</code> and <code>addr_type</code> arguments.
            </li>
          </ul></li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="cidr_to_bits"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">cidr_to_bits</span>(<span class="sig-arg">cidr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#cidr_to_bits">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>cidr</code></strong> - a CIDR object or CIDR string value (acceptable by CIDR class 
          constructor).</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a tuple containing CIDR in binary string format and addr_type.</dd>
  </dl>
</td></tr></table>
</div>
<a name="bits_to_cidr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">bits_to_cidr</span>(<span class="sig-arg">bits</span>,
        <span class="sig-arg">addr_type</span>=<span class="sig-default">0</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#bits_to_cidr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>bits</code></strong> - a CIDR in binary string format.</li>
        <li><strong class="pname"><code>addr_type</code></strong> - (optional) CIDR address type (IP version). (Default: AT_UNSPEC - 
          auto-select) If not specified AT_INET (IPv4) is assumed if length
          of binary string is &lt;= /32. If binary string is &gt; /32 and 
          &lt;= /128 AT_INET6 (IPv6) is assumed. Useful when you have IPv6 
          addresses with a prefixlen of /32 or less.</li>
        <li><strong class="pname"><code>fmt</code></strong> - (optional) callable invoked on return CIDR. (Default: None - CIDR
          object). Also accepts str() and unicode().</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a CIDR object or string (determined by fmt).</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-VariablesDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="AT_STRATEGIES"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">AT_STRATEGIES</h3>
  <p>Address type to strategy object lookup dict.</p>
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
{AT_UNSPEC: None, AT_INET: ST_IPV4, AT_INET6: ST_IPV6, AT_LINK: ST_EUI<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
48, AT_EUI64: ST_EUI64,}
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://netaddr.googlecode.com/">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Apr 13 15:14:39 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
